-------------------------------------------------------------------------------
-- Functions & Variables
-------------------------------------------------------------------------------
if not PQR_LoadedDataFile then
	PQR_LoadedDateFile = 1
	print("|cffFFBE69Nova Data File v2.3.2 - Jan 12, 2013|cffffffff")
end


--------------------------------------------------------------------------------------------------
--									Nova Functions												--
--------------------------------------------------------------------------------------------------
PQR_Spec = GetSpecialization()
PQR_LevelInfo = UnitLevel("player")
Nova_MajorVer = 120
Nova_MinorVer = 13

Nova_SpellAvailableTime = nil
function Nova_SpellAvailableTime()
	local lag = ((select(3,GetNetStats()) + select(4,GetNetStats())) / 1000)
	if lag < .05 then
		lag = .05
	elseif lag > .4 then
		lag = .4
	end
	return lag
end

Nova_UnitInfo = nil
function Nova_UnitInfo(t)
	-- Takes an input of UnitID (player, target, pet, mouseover, etc) and gives you their most useful info
		local TManaActual = UnitPower(t)
		local TMaxMana = UnitPowerMax(t)
		if TMaxMana == 0 then TMaxMana = 1 end			
		local TMana = 100 * UnitPower(t) / TMaxMana
		local THealthActual = UnitHealth(t)
		local THealth = 100 * UnitHealth(t) / UnitHealthMax(t) 
		local myClassPower = 0 
		local PQ_Class = select(2, UnitClass(t)) 
		local PQ_UnitLevel = UnitLevel(t)
		local PQ_CombatCheck = UnitAffectingCombat(t) 
		if PQ_Class == "PALADIN" then
			myClassPower = UnitPower("player", 9)
			if UnitBuffID("player", 90174) then
				myClassPower = myClassPower + 3
			end
		elseif PQ_Class == "PRIEST" then
			myClassPower = UnitPower("player", 13)
		elseif PQ_Class == "WARLOCK" then
			if PQR_Spec == 3 then
				myClassPower = UnitPower("player", 14) -- Destruction: Burning Embers
			elseif PQR_Spec == 2 then
				myClassPower = UnitPower("player", 15) -- Demonology: Demonic Fury
			elseif PQR_Spec == 1 then
				myClassPower = UnitPower("player", 7) -- Affliction: Soul Shards
			end
		elseif PQ_Class == "DRUID" and PQ_Class == 2 then
			myClassPower = UnitPower("player", 8)
		elseif PQ_Class == "MONK"  then
			myClassPower = UnitPower("player", 12)
		elseif PQ_Class == "ROGUE" and t ~= "player" then
			myClassPower = GetComboPoints("player", t)
		end
		--       1            2          3         4           5             6          7               8
		return THealth, THealthActual, TMana, TManaActual, myClassPower, PQ_Class, PQ_UnitLevel, PQ_CombatCheck
end

-- Self Explainatory
GlyphCheck = nil
function GlyphCheck(glyphid)
	for i=1, 6 do
		if select(4, GetGlyphSocketInfo(i)) == glyphid then
			return true
		end
	end
	return false
end

Nova_TargetInfo = nil
function Nova_TargetInfo(t)
	local TManaActual = UnitPower(t)
		local TMana = 100 
		local THealthActual = UnitHealth(t)
	local THealth = 100 * UnitHealth(t) / UnitHealthMax(t) 
	return THealth, THealthActual, TMana, TManaActual
end

--Tabled Cast Time Checking for When you Last Cast Something.
CheckCastTime = {}
Nova_CheckLastCast = nil
function Nova_CheckLastCast(spellid, ytime) -- SpellID of Spell To Check, How long of a gap are you looking for?
	if ytime > 0 then
		if #CheckCastTime > 0 then
			for i=1, #CheckCastTime do
				if CheckCastTime[i].SpellID == spellid then
					if GetTime() - CheckCastTime[i].CastTime > ytime then
						CheckCastTime[i].CastTime = GetTime()
						return true
					else
						return false
					end
				end
			end
		end
		table.insert(CheckCastTime, { SpellID = spellid, CastTime = GetTime() } )
		return true
	elseif ytime <= 0 then
		return true
	end
	return false
end

-- This is used for Shorter Threat Check Situations and PvP
Nova_ThreatCheck = nil
function Nova_ThreatCheck(unit1, unit2)
	if UnitIsPlayer(unit1) and UnitIsPlayer(unit2) then
		if UnitIsUnit(unit1, unit2.."target") then
			return true
		end
	elseif UnitDetailedThreatSituation(unit1, unit2) then
		return true
	end
	return false
end

-- Simplifying Range Check
Nova_Range = nil
function Nova_Range(spellid, spelltarget)
	if GetSpellInfo(spellid)
	 and UnitExists(spelltarget) then
	 	if IsSpellInRange(GetSpellInfo(spellid), spelltarget) == 1 then
	 		return true
	 	elseif IsSpellInRange(GetSpellInfo(spellif), spelltarget) == 0 then
	 		return false
	 	else
	 		return false
	 	end
	end
end

-- GUID Finder
Nova_GUID = nil
function Nova_GUID(unit)
	if UnitExists(unit) then
		if UnitIsPlayer(unit) then
			targetGUID = UnitGUID(unit)
		else
			targetGUID = tonumber((UnitGUID(unit)):sub(-12, -9), 16)
		end
	end
		
	return targetGUID
end

-- Universal Modifier Checker
Nova_Pause = nil
function Nova_Pause(num)
	local num = num or 0
	if num == 1 
		and IsLeftShiftKeyDown() 
		and not GetCurrentKeyBoardFocus() then
			return true
	elseif num == 2 
		and IsLeftControlKeyDown() 
		and not GetCurrentKeyBoardFocus() then
			return true
	elseif num == 3 
		and IsLeftAltKeyDown() 
		and not GetCurrentKeyBoardFocus() then
			return true
	elseif num == 4 
		and IsRightShiftKeyDown() 
		and not GetCurrentKeyBoardFocus() then
			return true
	elseif num == 5 
		and IsRightControlKeyDown() 
		and not GetCurrentKeyBoardFocus() then
			return true
	elseif num == 6 
		and IsRightAltKeyDown() 
		and not GetCurrentKeyBoardFocus() then
			return true
	end
	return false
end

Nova_Mod = nil
function Nova_Mod()
	total = 0
	if IsLeftShiftKeyDown()
		and not GetCurrentKeyBoardFocus() then
			total = total + 1
	end
	if IsLeftControlKeyDown()
		and not GetCurrentKeyBoardFocus() then
			total = total + 2
	end
	if IsLeftAltKeyDown()
		and not GetCurrentKeyBoardFocus() then
			total = total + 4
	end
	if IsRightShiftKeyDown()
		and not GetCurrentKeyBoardFocus() then
			total = total + 8
	end
	if IsRightControlKeyDown()
		and not GetCurrentKeyBoardFocus() then
			total = total + 16
	end
	if IsRightAltKeyDown()
		and not GetCurrentKeyBoardFocus() then
			total = total + 32
	end
	return total
end

Nova_CastingInfo = nil
function Nova_CastingInfo(PQ_Unit)
	local PQ_Casting = nil
	local percentRemaining = nil
	local secondsRemaining = nil

	if UnitCastingInfo(PQ_Unit) then
		local spellName,_,_,_,startTimer,endTimer = UnitCastingInfo(PQ_Unit)
		local durationTimer = ((endTimer) - (startTimer))
		local timeRemaining = (endTimer - GetTime() * 1000)
		percentRemaining = (100 - ((timeRemaining/durationTimer) * 100))
		secondsRemaining = endTimer/1000 - GetTime()
		PQ_Casting = spellName
		
		-- Name of spell, % remaining on spell, seconds remaining on spell
		return PQ_Casting, percentRemaining, secondsRemaining
	else return false end
end

-- Target Validation Function.
TargetValidation = nil
--[[function TargetValidation(unit, spell)
	local Nova_Spells = Nova_Spell
	
	if Nova_Spells[spell].known
		and UnitExists(unit)
		and PQR_SpellAvailable(spell)
		and UnitCanAttack("player", unit) == 1
	--	and IsSpellInRange(GetSpellInfo(spell), unit) == 1
		and not UnitIsDeadOrGhost(unit)
		and not PQR_IsOutOfSight(unit, 1)
	then return true else return false end
end]]--

function TargetValidation(unit, spell)
	if UnitExists(unit)
	 and IsPlayerSpell(spell) 
	 and UnitCanAttack("player", unit) == 1 
	 and not UnitIsDeadOrGhost(unit) 
	 and not PQR_IsOutOfSight(unit, 1) then
	 	if IsSpellKnown(spell) then  -- Redundent Check to see if Morphed Spell or not
	 		if PQR_SpellAvailable(spell) then
		 		if IsSpellInRange(GetSpellInfo(spell), unit) == 1 then
		 			return true
		 		else
		 			return false
		 		end
		 	else
		 		return false
		 	end
	 	else -- If spell is a morphed spell, return true without Range Check
	 		if select(2, GetSpellCooldown(spell)) == 0 then
	 			return true
	 		end
	 	end
	end
end
	 			


---------------------------------
-- Debug & Notification Frame
---------------------------------
-- Update Debug Frame
Nova_NotifyFrame = nil
function Nova_NotifyFrame_OnUpdate()
	if (Nova_NotifyFrameTime < GetTime() - 5) then
		local alpha = Nova_NotifyFrame:GetAlpha()
		if (alpha ~= 0) then Nova_NotifyFrame:SetAlpha(alpha - .02) end
		if (aplha == 0) then Nova_NotifyFrame:Hide() end
	end
end

-- Debug messages.
function Nova_Notify(message)
	Nova_NotifyFrame.text:SetText(message)
	Nova_NotifyFrame:SetAlpha(1)
	Nova_NotifyFrame:Show()
	Nova_NotifyFrameTime = GetTime()
end

-- Debug Notification Frame
Nova_NotifyFrame = CreateFrame('Frame')
Nova_NotifyFrame:ClearAllPoints()
Nova_NotifyFrame:SetHeight(300)
Nova_NotifyFrame:SetWidth(300)
Nova_NotifyFrame:SetScript('OnUpdate', Nova_NotifyFrame_OnUpdate)
Nova_NotifyFrame:Hide()
Nova_NotifyFrame.text = Nova_NotifyFrame:CreateFontString(nil, 'BACKGROUND', 'PVPInfoTextFont')
Nova_NotifyFrame.text:SetAllPoints()
Nova_NotifyFrame:SetPoint('CENTER', 0, 200)
Nova_NotifyFrameTime = 0

--------------------------------------------------------------------------------------------------
--									Copied Functions											--
--------------------------------------------------------------------------------------------------
Nova_CustomT = { }

----------------------------------------------
-- Sheuron Healing Functions
----------------------------------------------
function CalculateHP(t)
	incomingheals = UnitGetIncomingHeals(t) and UnitGetIncomingHeals(t) or 0
	local PercentWithIncoming = 100 * ( UnitHealth(t) + incomingheals ) / UnitHealthMax(t)
	local ActualWithIncoming = ( UnitHealthMax(t) - ( UnitHealth(t) + incomingheals ) )
	return PercentWithIncoming, ActualWithIncoming
end

function CanHeal(t)
	if UnitInRange(t) 
		and UnitCanCooperate("player",t) 
		and not UnitIsCharmed(t) 
		and not UnitIsDeadOrGhost(t) 
		and not PQR_IsOutOfSight(t) 
		and UnitIsConnected(t)
		and UnitDebuffID(t,104451) == nil -- Ice Tomb
		and UnitDebuffID(t,76577) == nil -- Smoke Bomb
		and UnitDebuffID(t, 121949) == nil -- Parasistic Growth
		and UnitDebuffID(t, 122784) == nil -- Reshape Life
		and UnitDebuffID(t, 122370) == nil -- Reshape Life 2
		and UnitDebuffID(t, 123184) == nil -- Dissonance Field
		and UnitDebuffID(t, 123255) == nli -- Dissonance Field 2
		and UnitDebuffID(t, 123596) == nil -- Dissonance Field 3 
		and UnitDebuffID(t, 128353) == nil -- Dissonance Field 4
		then return true else return false end 
end

function SheuronEngine(MO, LOWHP, ACTUALHP)
	Nova_Tanks = { }
	local MouseoverCheck = MO or false
	local ActualHP = ACTUALHP or false
	local LowHPTarget = LOWHP or 80
	lowhpmembers = 0
	members = { { Unit = "player", HP = CalculateHP("player"), GUID = UnitGUID("player"), AHP = select(2, CalculateHP("player")) } } 
	
	-- Check if the Player is apart of the Custom Table
	for i=1, #Nova_CustomT do 
		if UnitGUID("player") == Nova_CustomT[i].GUID then 
			Nova_CustomT[i].Unit = "player" 
			Nova_CustomT[i].HP = CalculateHP("player")
			Nova_CustomT[i].AHP = select(2, CalculateHP("player")) 
		end 
	end

	if IsInRaid() then
			group = "raid"
	elseif IsInGroup() then
			group = "party"
	end
	
	for i = 1, GetNumGroupMembers() do 
		local member, memberhp = group..i, CalculateHP(group..i)
		
		-- Checking all Party/Raid Members for Range/Health
		if CanHeal(member) then 
			-- Checking if Member has threat
			if UnitThreatSituation(member) == 3 then memberhp = memberhp - 1 end
			-- Checking if Member has Beacon on them
			if UnitBuffID(member, 53563) then memberhp = memberhp + 3 end 
			-- Searing Plasma Check
			if UnitDebuffID(member, 109379) then memberhp = memberhp - 9 end
			-- Checking if Member is a tank
			if UnitGroupRolesAssigned(member) == "TANK" then 
				memberhp = memberhp - 1 
				table.insert(Nova_Tanks, { Unit = member, HP = memberhp, AHP = select(2, CalculateHP(member)) } )
			end			
			-- If they are in the Custom Table add their info in
			for i=1, #Nova_CustomT do 
				if UnitGUID(member) == Nova_CustomT[i].GUID then 
					Nova_CustomT[i].Unit = member 
					Nova_CustomT[i].HP = memberhp 
					Nova_CustomT[i].AHP = select(2, CalculateHP(member))
				end 
			end 
			
			table.insert( members,{ Unit = group..i, HP = memberhp, GUID = UnitGUID(group..i), AHP = select(2, CalculateHP(group..i)) } ) 
		end 
		
		-- Checking Pets in the group
		if CanHeal(group..i.."pet") then
			local memberpet, memberpethp = nil, nil
			if UnitAffectingCombat("player") then
				 memberpet = group..i.."pet" 
				 memberpethp = CalculateHP(group..i.."pet") * 2
			else
				 memberpet = group..i.."pet"
				 memberpethp = CalculateHP(group..i.."pet")
			end
			
			-- Checking if Pet is apart of the CustomTable
			for i=1, #Nova_CustomT do 
				if UnitGUID(memberpet) == Nova_CustomT[i].GUID then 
					Nova_CustomT[i].Unit = memberpet 
					Nova_CustomT[i].HP = memberpethp
					Nova_CustomT[i].AHP = select(2, CalculateHP(memberpet)) 
				end
			end
			
			table.insert(members, { Unit = memberpet, HP = memberpethp, GUID = UnitGUID(memberpet), AHP = select(2, CalculateHP(memberpet)) } )
		end
	end 
	
	-- So if we pass that ActualHP is true, then we will sort by most health missing. If not, we sort by lowest % of health.
	if not ActualHP then
		table.sort(members, function(x,y) return x.HP < y.HP end)
		if #Nova_Tanks > 0 then
			table.sort(Nova_Tanks, function(x,y) return x.HP < y.HP end)
		end
	elseif ActualHP then
		table.sort(members, function(x,y) return x.AHP > y.AHP end)
		if #Nova_Tanks > 0 then
			table.sort(Nova_Tanks, function(x,y) return x.AHP > y.AHP end)
		end
	end
	
	-- Setting Low HP Members variable for AoE Healing
	for i=1,#members do
		if members[i].HP < LowHPTarget then
			lowhpmembers = lowhpmembers + 1
		end
	end
	
	-- Checking Priority Targeting
	if CanHeal("target") then
		table.sort(members, function(x) return UnitIsUnit("target",x.Unit) end)
	elseif CanHeal("mouseover") and GetMouseFocus() ~= WorldFrame and MouseoverCheck then
		table.sort(members, function(x) return UnitIsUnit("mouseover",x.Unit) end)
	end
end

function CheckDistance(unit1,unit2)
	local x1,y1 = GetPlayerMapPosition(unit1)
	local x2,y2 = GetPlayerMapPosition(unit2)
	
	return sqrt( (x1-x2)^2 + (y1-y2)^2 )
end

function UnitsClose(t, percent)
	local PercentToHeal = percent or 85
	local n = 0
	
	if distance and distance[1] then
		for i=1,#members do
			local x = CheckDistance(t,members[i].Unit)
			if x ~= 0 and x < distance[1] and members[i].HP < PercentToHeal then n = n + 1 end
		end
	end
	return n
end

function GetDistance() 
	local playerx,playery = GetPlayerMapPosition("player")
	
	if GetCurrentMapAreaID() ~= xrnMap or GetCurrentMapDungeonLevel() ~= xrnDung then
		xrnMap,xrnDung = GetCurrentMapAreaID(), GetCurrentMapDungeonLevel()
		mp, distance = {}, {}
	end
	
	if #members > 1 and #distance < 10 and playerx ~= 0 and playery ~= 0 then
		for i=1,#members do
			if CheckInteractDistance(members[i].Unit,2) then
				mp[members[i].Unit] = {GetPlayerMapPosition(members[i].Unit)}
			elseif UnitInRange(members[i].Unit) and mp[members[i].Unit] then
				table.insert(distance,sqrt((mp[members[i].Unit][1] - playerx)^2 + (mp[members[i].Unit][2] - playery)^2))
				table.sort(distance)
				mp[members[i].Unit] = nil
			end
		end
	end
end
--------------------------------------------------------------------------------------------------
--									Libraries													--
--------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Target & Environmental Globals and Tables
-------------------------------------------------------------------------------
PQ_Shrapnel			= {106794,106791}
PQ_FadingLight		= {105925,105926,109075,109200}
PQ_HourOfTwilight	= {106371,103327,106389,106174,106370}


-- Heroism Function.
PQ_HasHero = nil
function PQ_HasHero()
	local PQ_BL = PQ_BloodLust
	local PQ_Hero = PQ_Heroism
	local PQ_TW = PQ_TimeWarp
	local PQ_AH = PQ_Hysteria

	if UnitBuffID("player",PQ_BL)
		or UnitBuffID("player",PQ_Hero)
		or UnitBuffID("player",PQ_TW)
		or UnitBuffID("player",PQ_AH)
	then return true else return false end
end

PQ_BossUnits = {
	-- Cataclysm Dungeons --
	-- Abyssal Maw: Throne of the Tides
	40586,		-- Lady Naz'jar
	40765,		-- Commander Ulthok
	40825,		-- Erunak Stonespeaker
	40788,		-- Mindbender Ghur'sha
	42172,		-- Ozumat
	-- Blackrock Caverns
	39665,		-- Rom'ogg Bonecrusher
	39679,		-- Corla, Herald of Twilight
	39698,		-- Karsh Steelbender
	39700,		-- Beauty
	39705,		-- Ascendant Lord Obsidius
	-- The Stonecore
	43438,		-- Corborus
	43214,		-- Slabhide
	42188,		-- Ozruk
	42333,		-- High Priestess Azil
	-- The Vortex Pinnacle
	43878,		-- Grand Vizier Ertan
	43873,		-- Altairus
	43875,		-- Asaad
	-- Grim Batol
	39625,		-- General Umbriss
	40177,		-- Forgemaster Throngus
	40319,		-- Drahga Shadowburner
	40484,		-- Erudax
	-- Halls of Origination
	39425,		-- Temple Guardian Anhuur
	39428,		-- Earthrager Ptah
	39788,		-- Anraphet
	39587,		-- Isiset
	39731,		-- Ammunae
	39732,		-- Setesh
	39378,		-- Rajh
	-- Lost City of the Tol'vir
	44577,		-- General Husam
	43612,		-- High Prophet Barim
	43614,		-- Lockmaw
	49045,		-- Augh
	44819,		-- Siamat
	-- Zul'Aman
	23574,		-- Akil'zon
	23576,		-- Nalorakk
	23578,		-- Jan'alai
	23577,		-- Halazzi
	24239,		-- Hex Lord Malacrass
	23863,		-- Daakara
	-- Zul'Gurub
	52155,		-- High Priest Venoxis
	52151,		-- Bloodlord Mandokir
	52271,		-- Edge of Madness
	52059,		-- High Priestess Kilnara
	52053,		-- Zanzil
	52148,		-- Jin'do the Godbreaker
	-- End Time
	54431,		-- Echo of Baine
	54445,		-- Echo of Jaina
	54123,		-- Echo of Sylvanas
	54544,		-- Echo of Tyrande
	54432,		-- Murozond
	-- Hour of Twilight
	54590,		-- Arcurion
	54968,		-- Asira Dawnslayer
	54938,		-- Archbishop Benedictus
	-- Well of Eternity
	55085,		-- Peroth'arn
	54853,		-- Queen Azshara
	54969,		-- Mannoroth
	55419,		-- Captain Varo'then
	
	-- Mists of Pandaria Dungeons --
	-- Scarlet Halls
	59303,		-- Houndmaster Braun
	58632,		-- Armsmaster Harlan
	59150,		-- Flameweaver Koegler
	-- Scarlet Monastery
	59789,		-- Thalnos the Soulrender
	59223,		-- Brother Korloff
	3977,		-- High Inquisitor Whitemane
	60040,		-- Commander Durand
	-- Scholomance
	58633,		-- Instructor Chillheart
	59184,		-- Jandice Barov
	59153,		-- Rattlegore
	58722,		-- Lilian Voss
	58791,		-- Lilian's Soul
	59080,		-- Darkmaster Gandling
	-- Stormstout Brewery
	56637,		-- Ook-Ook
	56717,		-- Hoptallus
	59479,		-- Yan-Zhu the Uncasked
	-- Tempe of the Jade Serpent
	56448,		-- Wise Mari
	56843,		-- Lorewalker Stonestep
	59051,		-- Strife
	59726,		-- Peril
	58826,		-- Zao Sunseeker
	56732,		-- Liu Flameheart
	56762,		-- Yu'lon
	56439,		-- Sha of Doubt
	-- Mogu'shan Palace
	61444,		-- Ming the Cunning
	61442,		-- Kuai the Brute
	61445,		-- Haiyan the Unstoppable
	61243,		-- Gekkan
	61398,		-- Xin the Weaponmaster
	-- Shado-Pan Monastery
	56747,		-- Gu Cloudstrike
	56541,		-- Master Snowdrift
	56719,		-- Sha of Violence
	56884,		-- Taran Zhu
	-- Gate of the Setting Sun
	56906,		-- Saboteur Kip'tilak
	56589,		-- Striker Ga'dok
	56636,		-- Commander Ri'mok
	56877,		-- Raigonn
	-- Siege of Niuzao Temple
	61567,		-- Vizier Jin'bak
	61634,		-- Commander Vo'jak
	61485,		-- General Pa'valak
	62205,		-- Wing Leader Ner'onok

	-- Training Dummies --
	46647,		-- Level 85 Training Dummy
	67127		-- Level 90 Training Dummy
}

SpecialUnit = nil
function SpecialUnit()
	local PQ_BossUnits = PQ_BossUnits
	
	if UnitExists("target") then
		local npcID = tonumber(UnitGUID("target"):sub(6,10), 16)
		
		-- Use Cooldowns on Opposing Faction members
		if UnitFactionGroup("player") ~= UnitFactionGroup("target") then return true end
		
		-- Dungeons & Raids
		if UnitLevel("target") == -1 then return true else
			for i=1,#PQ_BossUnits do
				if PQ_BossUnits[i] == npcID then return true end
			end
			return false
		end
	else return false end
end


-- Special Aggro Conditions
PQ_Aggro = {
	60410, 	-- Elegon
	63053	-- Garalon's Leg
}
	 


-------------------------------------------------------------------------------
-- Buff Globals
-------------------------------------------------------------------------------
-- Aura Info function.
buffs = {
	stat 		=	{ 90363, 20217,	115921, 1126 },
	stamina		= 	{ 469, 6307, 103127, 90364, 21562},
	atkpwr		= 	{ 19506, 57330,	6673 },
	atkspeed	=	{ 55610, 113742, 30809, 128432, 128433 },
	spllpwr		=	{ 77747, 109773, 126309, 61316, 1459 },
	spllhaste	= 	{ 24907, 15473, 51470, 49868 },
	crit		=	{ 17007, 1459, 61316, 116781, 97229, 24604, 90309, 126373, 126309 },
	mastery		=	{ 116956, 19740, 93435, 128997 },
}

PQ_AuraInfo = nil
function PQ_AuraInfo(i)
	if i == 1 then
		for x = 1, #buffs.stat do
			local name, _, texture = UnitBuff("Player", (GetSpellInfo(buffs.stat[x])))
			if texture then
				return name, _, texture
			end
		end
	elseif i == 2 then
		for x = 1, #buffs.stamina do
			local name, _, texture = UnitBuff("Player", (GetSpellInfo(buffs.stamina[x])))
			if texture then
				return name, _, texture
			end
		end
	elseif i == 3 then
		for x = 1, #buffs.atkpwr do
			local name, _, texture = UnitBuff("Player", (GetSpellInfo(buffs.atkpwr[x])))
			if texture then
				return name, _, texture
			end
		end
	elseif i == 4 then
		for x = 1, #buffs.atkspeed do
			local name, _, texture = UnitBuff("Player", (GetSpellInfo(buffs.atkspeed[x])))
			if texture then
				return name, _, texture
			end
		end
	elseif i == 5 then
		for x = 1, #buffs.spllpwr do
			local name, _, texture = UnitBuff("Player", (GetSpellInfo(buffs.spllpwr[x])))
			if texture then
				return name, _, texture
			end
		end
	elseif i == 6 then
		for x = 1, #buffs.spllhaste do
			local name, _, texture = UnitBuff("Player", (GetSpellInfo(buffs.spllhaste[x])))
			if texture then
				return name, _, texture
			end
		end
	elseif i == 7 then
		for x = 1, #buffs.crit do
			local name, _, texture = UnitBuff("Player", (GetSpellInfo(buffs.crit[x])))
			if texture then
				return name, _, texture
			end
		end
	elseif i == 8 then
		for x = 1, #buffs.mastery do
			local name, _, texture = UnitBuff("Player", (GetSpellInfo(buffs.mastery[x])))
			if texture then
				return name, _, texture
			end
		end
	else 
		return nil, nil, nil
	end
end

-- Temporary Buffs
PQ_Lightweave		= 125487
PQ_PowerTorrent		= 74241
PQ_VolcanicPotion	= 79476
PQ_SynapseSprings	= 96230
PQ_JadeSerpent		= 105702
PQ_JadeSpirit		= 104993
PQ_BloodLust		= 2825
PQ_Heroism			= 32182
PQ_TimeWarp			= 80353
PQ_Hysteria			= 90355
PQ_Zerk				= 26297

-- Temporary Bloodlust
Nova_Lust = {PQ_Bloodlust,PQ_Heroism,PQ_TimeWarp,PQ_Hysteria}

-- Temporary Buff Table
PQ_TemporaryBuffs = {
	{spellID = PQ_JadeSpirit, check = true, hasBuff = false, endTime = nil},
	{spellID = PQ_Lightweave, check = true, hasBuff = false, endTime = nil},
	{spellID = PQ_JadeSerpent, check = true, hasBuff = false, endTime = nil},
	{spellID = PQ_PowerTorrent, check = true, hasBuff = false, endTime = nil},
	{spellID = PQ_VolcanicPotion, check = true, hasBuff = false, endTime = nil},
	{spellID = PQ_SynapseSprings, check = true, hasBuff = false, endTime = nil}
}

PQ_CheckTempBuffs = nil
function PQ_CheckTempBuffs(t)
	for i=1,#t do
		if t[i].check == true and UnitBuffID("player",t[i].spellID) then
			t[i].hasBuff = true
			t[i].endTime = select(7,UnitBuffID("player",t[i].spellID))
		else
			t[i].hasBuff = false
			t[i].endTime = nil
		end
	end
end

PQ_GetTimeLeft = nil
function PQ_GetTimeLeft(t, spellID)
	for i=1,#t do
		if t[i].spellID == spellID and t[i].hasBuff == true then
			return t[i].endTime - GetTime()
		end
	end
end

PQ_Round = nil
function PQ_Round(number, decimal)
	local multiplier = 10^(decimal or 0)
	return math.floor(number * multiplier + 0.5) / multiplier
end
-------------------------------------------------------------------------------
-- Mage Combustion Library
-------------------------------------------------------------------------------
function MCFrame_OnEvent(self,event,...)
	if event == "COMBAT_LOG_EVENT_UNFILTERED" then
		local subEvent		= select(2, ...)
		local source		= select(5, ...)
		local destination	= select(9, ...)
		local spell			= select(13, ...)
		local damage		= select(15, ...)
		local critical		= select(21, ...)
		
		if subEvent == "SPELL_PERIODIC_DAMAGE" then
			if UnitName("player") == source and destination == UnitName("target") then
				if spell == GetSpellInfo(12654) then  
					IgniteDamage = damage 
				end
			end
		end
		if subEvent == "SPELL_AURA_REMOVED" then
			if UnitName("player") == source then
				if spell == GetSpellInfo(12654) then  
					IgniteDamage = 0 
				end
			end
			if UnitName("player") == source then
				if spell == GetSpellInfo(44457) then
					LivingBomb = LivingBomb - 1
				end
				if spell == GetSpellInfo(104423) then
					Trinket = Trinket - 1
				end
				if spell == GetSpellInfo(128985) then
					Trinket = Trinket - 1
				end
				if spell == GetSpellInfo(125487) then
					Trinket = Trinket - 1
				end
				if spell == GetSpellInfo(96230) then
					Trinket = Trinket - 1
				end
				if spell == GetSpellInfo(105702) then
					Trinket = Trinket - 1
				end
				if spell == GetSpellInfo(104993) then
					Trinket = Trinket - 1
				end
				if spell == GetSpellInfo(26297) then
					Trinket = Trinket - 1
				end
				if spell == GetSpellInfo(33702) then
					Trinket = Trinket - 1
				end
				if spell == GetSpellInfo(126577) then
					Trinket = Trinket - 1
				end
				if spell == GetSpellInfo(2825) then
					Trinket = Trinket - 1
				end
				if spell == GetSpellInfo(32182) then
					Trinket = Trinket - 1
				end
				if spell == GetSpellInfo(80353) then
					Trinket = Trinket - 1
				end
				if spell == GetSpellInfo(90355) then
					Trinket = Trinket - 1
				end
				if spell == GetSpellInfo(126659) then
					Trinket = Trinket - 1
				end
				if spell == GetSpellInfo(126478) then
					Trinket = Trinket - 1
				end
				if spell == GetSpellInfo(136082) then
					Trinket = Trinket - 1
				end
				if spell == GetSpellInfo(126605) then
					Trinket = Trinket - 1
				end
				if spell == GetSpellInfo(126476) then
					Trinket = Trinket - 1
				end
				if spell == GetSpellInfo(136089) then
					Trinket = Trinket - 1
				end
			end
		end
		if subEvent == "SPELL_AURA_APPLIED" then
			if UnitName("player") == source then
				if spell == GetSpellInfo(44457) then
					LivingBomb = LivingBomb + 1
				end
				if spell == GetSpellInfo(104423) then
					Trinket = Trinket + 1
				end
				if spell == GetSpellInfo(128985) then
					Trinket = Trinket + 1
				end
				if spell == GetSpellInfo(125487) then
					Trinket = Trinket + 1
				end
				if spell == GetSpellInfo(96230) then
					Trinket = Trinket + 1
				end
				if spell == GetSpellInfo(105702) then
					Trinket = Trinket + 1
				end
				if spell == GetSpellInfo(104993) then
					Trinket = Trinket + 1
				end
				if spell == GetSpellInfo(26297) then
					Trinket = Trinket + 1
				end
				if spell == GetSpellInfo(33702) then
					Trinket = Trinket + 1
				end
				if spell == GetSpellInfo(126577) then
					Trinket = Trinket + 1
				end
				if spell == GetSpellInfo(2825) then
					Trinket = Trinket + 1
				end
				if spell == GetSpellInfo(32182) then
					Trinket = Trinket + 1
				end
				if spell == GetSpellInfo(80353) then
					Trinket = Trinket + 1
				end
				if spell == GetSpellInfo(90355) then
					Trinket = Trinket + 1
				end
				if spell == GetSpellInfo(126659) then
					Trinket = Trinket + 1
				end
				if spell == GetSpellInfo(126478) then
					Trinket = Trinket + 1
				end
				if spell == GetSpellInfo(136082) then
					Trinket = Trinket + 1
				end
				if spell == GetSpellInfo(126605) then
					Trinket = Trinket + 1
				end
				if spell == GetSpellInfo(126476) then
					Trinket = Trinket + 1
				end
				if spell == GetSpellInfo(136089) then
					Trinket = Trinket + 1
				end
			end
		end
		if subEvent == "SPELL_DAMAGE" then
			if UnitName("player") == source and destination == UnitName("target") then
				if spell == GetSpellInfo(11366) then  
					PyroDamage = damage
					if critical == 1 then PyroCrit = 1 else PyroCrit = 0 end
				end
			end
		end
	end
end

--------------------------------------------------------------------------------------------------
--									Tables														--
--------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Paladin Globals
-------------------------------------------------------------------------------
if select(2, UnitClass("player")) == "PALADIN" then
	--print("|cffFFBE69Loading |cffF48CBAPaladin|cffFFBE69 Tables ...|cffffffff")
	
	-- Constants
	PQ_HolyLight 		=	 635
	PQ_DivineLight 		=	 82326
	PQ_FlashofLight 	=	 19750
	PQ_HolyRadiance 	=	 82327
	PQ_HolyShock 		=	 20473
	PQ_WordofGlory 		=	 85673
	PQ_LightofDawn 		=	 85222
	PQ_Exorcism 		=  	 879
	PQ_Judgement 		=	 20271
	PQ_DivineShield 	=	 642 
	PQ_DivineProtection = 	 498 
	PQ_AuraMastery 		=	 31821 
	PQ_BeaconofLight 	=	 53563
	PQ_Cleanse 			=	 4987
	PQ_HandofFreedom 	=	 1044
	PQ_HandofProtection =	 1022
	PQ_HandofSacrifice	= 	 6940
	PQ_HandofSalvation	=	 1038
	PQ_GoAK 			=	 86150
	PQ_DivineFavor	 	=	 31842
	PQ_AvengingWrath 	=	 31884
	PQ_DivinePlea	 	=	 54428
	PQ_LayonHands 		=	 633 
	PQ_SealofInsight 	=	 20165
	PQ_CrusaderStrike 	=	 35395
	PQ_SoR				=	 20154
	PQ_SoI				=	 20165
	PQ_SoT				=	 31801
	PQ_SoJ				=	 20164
	PQ_AvengersShield 	=	 31935
	PQ_HandofReckoning 	=	 62124
	PQ_SotR 			=	 53600
	PQ_Consecrate 		=	 26573
	PQ_HotR 			=	 53595
	PQ_HoJ				=	 853
	PQ_SacredShield		=	 20925
	PQ_HoW				=	 24275
	PQ_BoM				=	 19740
	PQ_BoK				=	 20217
	PQ_FistofJustice	=	 105593
	PQ_SpeedofLight		=	 85499
	PQ_Repentance		=	 20066
	PQ_EternalFlame		=	 114163
	PQ_HandofPurity		=	 114039
	PQ_HolyAvenger		=	 105809
	PQ_HolyPrism		=	 114165
	PQ_LightsHammer		=	 114158
	PQ_ExecutionSentence =	 114157
	
	--[[ Paladin Skill table
	Nova_Spell = {
		[PQ_HolyLight] 			=	 { check = true, castTime = 2.5, isKnown = IsPlayerSpell(635), targetHealth = 92, overHealLimit = 103, overRide = false },
		[PQ_DivineLight]		=	 { check = true, castTime = 2.5, isKnown = IsPlayerSpell(82326), targetHealth = 58, checkArena = false, overHealLimit = 107, overRide = false},
		[PQ_FlashofLight]		=	 { check = true, castTime = 1.5, isKnown = IsPlayerSpell(19750), targetHealth = 32, whileMovingHealth = 65, checkArena = false, overHealLimit = 101, overRide = false },
		[PQ_HolyRadiance]		=	 { check = true, castTime = 2.5, isKnown = IsPlayerSpell(82327), targetNumber = 4, targetHealth = 85, overRide = false },
		[PQ_HolyShock] 			=	 { check = true, castTime = 0, isKnown = IsPlayerSpell(20473), targetHealth = 95, overRide = false },
		[PQ_WordofGlory] 		=	 { check = true, castTime = 0, isKnown = IsPlayerSpell(85673), targetHealth = 82, overRide = false },
		[PQ_LightofDawn] 		=	 { check = true, castTime = 0, isKnown = IsPlayerSpell(85222), targetNumber = 3, overRide = false },
		[PQ_Exorcism] 			=	 { check = false, castTime = 1.5, isKnown = IsPlayerSpell(879) },
		[PQ_DivineShield] 		=	 { check = true, castTime = 0, isKnown = IsPlayerSpell(642), playerHealth = 22 },
		[PQ_DivineProtection] 	=	 { check = true, castTime = 0, isKnown = IsPlayerSpell(498), playerHealth = 45 },
		[PQ_AuraMastery] 		=	 { check = true, castTime = 0, isKnown = IsPlayerSpell(31821) },
		[PQ_BeaconofLight] 		=	 { check = true, castTime = 0, isKnown = IsPlayerSpell(53563), targetName = "" },
		[PQ_Cleanse] 			=	 { check = true, castTime = 0, isKnown = IsPlayerSpell(4987), prioDispel = 0 },
		[PQ_HandofFreedom] 		=	 { check = true, castTime = 0, isKnown = IsPlayerSpell(1044) },
		[PQ_HandofProtection] 	=	 { check = false, castTime = 0, isKnown = IsPlayerSpell(1022), targetHealth = 40 },
		[PQ_HandofSalvation] 	=	 { check = true, castTime = 0, isKnown = IsPlayerSpell(1038) },
		[PQ_HandofSacrifice] 	=	 { check = true, castTime = 0, isKnown = IsPlayerSpell(6940), targetHealth = 40 },
		[PQ_GoAK] 				=	 { check = true, castTime = 0, isKnown = IsPlayerSpell(86150), targetHealth = 30 },
		[PQ_DivineFavor] 		=	 { check = true, castTime = 0, isKnown = IsPlayerSpell(31842), targetHealth = 38 },
		[PQ_AvengingWrath] 		=	 { check = true, castTime = 0, isKnown = IsPlayerSpell(31884), targetHealth = 45 },
		[PQ_DivinePlea] 		=	 { check = true, castTime = 0, isKnown = IsPlayerSpell(54428), playerMana = 80 },
		[PQ_CrusaderStrike] 	=	 { check = true, isKnown = IsPlayerSpell(35395) },
		[PQ_Judgement] 			=	 { check = true, isKnown = IsPlayerSpell(20271) },
		[PQ_SoR] 				=	 { check = true, isKnown = IsPlayerSpell(20154) },
		[PQ_SoI] 				=	 { check = true, isKnown = IsPlayerSpell(20165) },
		[PQ_SoT] 				=	 { check = true, isKnown = IsPlayerSpell(31801) },
		[PQ_SoJ] 				=	 { check = true, isKnown = IsPlayerSpell(20164) },
		[PQ_AvengersShield] 	=	 { check = true, isKnown = IsPlayerSpell(31935) },
		[PQ_HandofReckoning] 	=	 { check = true, isKnown = IsPlayerSpell(62124) },
		[PQ_Consecrate] 		=	 { check = true, isKnown = IsPlayerSpell(26573) },
		[PQ_HotR] 				=	 { check = true, isKnown = IsPlayerSpell(53595) },
		[PQ_SotR] 				=	 { check = true, isKnown= IsPlayerSpell(53600) },
		[PQ_HoW] 				=	 { check = true, isKnown = IsPlayerSpell(24275) },
		[PQ_HoJ] 				=	 { check = true, isKnown = IsPlayerSpell(853) },
		[PQ_BoM] 				=	 { check = true, isKnown = IsPlayerSpell(19740) },
		[PQ_BoK] 				=	 { check = true, isKnown= IsPlayerSpell(20217) },
--		[PQ_FistofJustice		=	 { check = true, isKnown = IsPlayerSpell(105593) },
--		[PQ_Repentance]			=	 { check = true, isKnown= IsPlayerSpell(20066) },
--		[PQ_SpeedofLight]		=	 { check = true, isKnown = IsPlayerSpell(85499) },
--		[PQ_EternalFlame]		=	 { check = true, isKnown = IsPlayerSpell(114163) },
--		[PQ_SacredShield]		=	 { check = true, isKnown = IsPlayerSpell(20925) },
--		[PQ_HandofPurity]		=	 { check = true, isKnown= IsPlayerSpell(114039) },
--		[PQ_HolyAvenger]		=	 { check = true, isKnown = IsPlayerSpell(105809) },
--		[PQ_HolyPrism]			=	 { check = true, isKnown= IsPlayerSpell(114165) },
--		[PQ_LightsHammer]		=	 { check = true, isKnown = IsPlayerSpell(114158) },
--		[PQ_ExecutionSentence]	=	 { check = true, isKnown= IsPlayerSpell(114157) },
		[PQ_LayonHands]			=	 { check = true, castTime = 0, isKnown = IsPlayerSpell(633), targetHealth = 20 }
	}]]--
-------------------------------------------------------------------------------
-- Priest Globals
-------------------------------------------------------------------------------
elseif select(2, UnitClass("player")) == "PRIEST" then
	print("|cffFFBE69Loading |cffffffffPriest|cffFFBE69 Tables ...|cffffffff")
	
	-- Skill IDs
	PQ_DP		= 2944			-- Devouring Plague
	PQ_SWD		= 32379			-- Shadow Word: Death
	PQ_MB		= 8092			-- Mind Blast
	PQ_SWP		= 589			-- Shadow Word: Pain
	PQ_VT		= 34914			-- Vampiric Touch
	PQ_MS		= 73510			-- Mind Spike
	PQ_MF		= 15407			-- Mind Flay
	PQ_MSear	= 48045			-- Mind Sear
	
	-- Cooldowns
	PQ_SF		= 34433			-- Shadowfiend
	PQ_Disp		= 47585			-- Dispersion
	PQ_DPrayer	= 19236			-- Desperate Prayer
	
	-- Holy/Discipline
	PQ_Purify	= 527
	PQ_FW 		= 6346
	PQ_PWS 		= 17
	PQ_IW 		= 73413
	PQ_SU		= 9484
	PQ_Lev 		= 1706
	PQ_ManaBurn	= 8129
	PQ_Fade 	= 586
	PQ_MV 		= 2096
	PQ_PsychicS	= 8122
	PQ_MC 		= 605
	PQ_MSoothe 	= 453
	PQ_SF 		= 34433
	PQ_BH 		= 32546
	PQ_DM	 	= 528
	PQ_DHymn 	= 64843
	PQ_FH 		= 2061
	PQ_GH 		= 2060
	PQ_Heal 	= 2050
	PQ_HF 		= 14914
	PQ_HN 		= 15237
	PQ_HoH 		= 64901
	PQ_LoF 		= 73325
	PQ_PoH 		= 596
	PQ_PoM 		= 33076
	PQ_Renew 	= 139
	PQ_Rez 		= 2006
	PQ_Smite 	= 585
	
	-- Specialization Spells
	PQ_Penance 	= 47540
	PQ_PWB 		= 62618
	PQ_AA	 	= 87151
	PQ_IFocus	= 89485
	PQ_PS 		= 33206
	PQ_HWC 		= 88625
	PQ_LW 		= 724
	PQ_GS 		= 47788
	PQ_Chakra 	= 14751
	PQ_CoH 		= 34861
	
	-- Buffs
	PQ_IF		= 588			-- Inner Fire
	PQ_SForm	= 15473			-- Shadow Form
	PQ_PWF		= 21562			-- Power Word: Fortitude
	PQ_GMS		= 81292			-- Glyph of Mind Spike
	
	-- Procs
	PQ_SOD		= 87160 		-- Surge of Darkness
	PQ_DI		= 124430		-- Divine Insight
	
	-- Talents
	PQ_PI		= 10060			-- Power Infusion
	PQ_FDCL		= 109186		-- From Darkness, Comes Light
	PQ_Solace	= 129250		-- Power Word: Solace
	PQ_SWI		= 129250		-- Power Word: Insanity
	PQ_MBen		= 123040		-- Mindbender
	PQ_Halo		= 120517		-- Halo
	PQ_DarkHalo	= 120644		-- Dark Halo
	PQ_Cascade	= 121135		-- Cascade
	PQ_DCascade = 127632		-- Dark Cascade
	PQ_Star		= 110744		-- Divine Star
	PQ_DStar	= 122121		-- Dark Star
	
	-- Spell Table
	Nova_Spell = {
		-- Shadow
		[PQ_DP]			= {check = true, known = IsPlayerSpell(PQ_DP)},
		[PQ_MB]			= {check = true, known = IsPlayerSpell(PQ_MB)},
		[PQ_VT]			= {check = true, known = IsPlayerSpell(PQ_VT)},
		[PQ_MS]			= {check = true, known = IsPlayerSpell(PQ_MS)},
		[PQ_MF]			= {check = true, known = IsPlayerSpell(PQ_MF)},
		[PQ_SF]			= {check = true, known = IsPlayerSpell(PQ_SF)},
		[PQ_IF]			= {check = true, known = IsPlayerSpell(PQ_IF)},
		[PQ_SWD]		= {check = true, known = IsPlayerSpell(PQ_SWD)},
		[PQ_SWP]		= {check = true, known = IsPlayerSpell(PQ_SWP)},
		[PQ_PWF]		= {check = true, known = IsPlayerSpell(PQ_PWF)},
		[PQ_SWI]		= {check = true, known = IsPlayerSpell(PQ_SWI)},
		[PQ_Star]		= {check = true, known = IsPlayerSpell(PQ_Star)},
		[PQ_MBen]		= {check = true, known = IsPlayerSpell(PQ_MBen)},
		[PQ_Disp]		= {check = true, known = IsPlayerSpell(PQ_Disp)},
		[PQ_FDCL]		= {check = true, known = IsPlayerSpell(PQ_FDCL)},
		[PQ_Halo]		= {check = true, known = IsPlayerSpell(PQ_Halo)},
		[PQ_MSear]		= {check = true, known = IsPlayerSpell(PQ_MSear)},
		[PQ_SForm]		= {check = true, known = IsPlayerSpell(PQ_SForm)},
		[PQ_Solace]		= {check = true, known = IsPlayerSpell(PQ_Solace)},
		[PQ_DPrayer]	= {check = true, known = IsPlayerSpell(PQ_DPrayer)},
		[PQ_Cascade]	= {check = true, known = IsPlayerSpell(PQ_Cascade)},
		
		-- Holy / Discipline
		[PQ_FW] 		= {check = true, isKnown = IsPlayerSpell(PQ_FW)},
		[PQ_LW]			= {check = true, isKnown = IsPlayerSpell(PQ_LW)},
		[PQ_IW] 		= {check = true, isKnown = IsPlayerSpell(PQ_IW)},
		[PQ_SU] 		= {check = true, isKnown = IsPlayerSpell(PQ_SU)},
		[PQ_MV] 		= {check = true, isKnown = IsPlayerSpell(PQ_MV)},
		[PQ_MC] 		= {check = true, isKnown = IsPlayerSpell(PQ_MC)},
		[PQ_HF] 		= {check = true, isKnown = IsPlayerSpell(PQ_HF)},
		[PQ_DM] 		= {check = true, isKnown = IsPlayerSpell(PQ_DM)},
		[PQ_HoH] 		= {check = true, isKnown = IsPlayerSpell(PQ_HoH)},
		[PQ_Lev] 		= {check = true, isKnown = IsPlayerSpell(PQ_Lev)},
		[PQ_Rez] 		= {check = true, isKnown = IsPlayerSpell(PQ_Rez)},
		[PQ_Fade] 		= {check = true, isKnown = IsPlayerSpell(PQ_Fade)},
		[PQ_Purify]		= {check = true, isKnown = IsPlayerSpell(PQ_Purify)},
		[PQ_MSoothe] 	= {check = true, isKnown = IsPlayerSpell(PQ_MSoothe)},
		[PQ_ManaBurn] 	= {check = true, isKnown = IsPlayerSpell(PQ_ManaBurn)},
		[PQ_PsychicS] 	= {check = true, isKnown = IsPlayerSpell(PQ_PsychicS)},
		[PQ_GS] 		= {check = true, isKnown = IsPlayerSpell(PQ_GS), targetHealth = 80  },
		[PQ_Chakra] 	= {check = true, isKnown = IsPlayerSpell(PQ_Chakra), overRide = false},
		[PQ_PWS] 		= {check = true, isKnown = IsPlayerSpell(PQ_PWS), overRide = false, targetHealth = 90, overHealLimit = 80},
		[PQ_PI] 		= {check = true, isKnown = IsPlayerSpell(PQ_PI), overRide = false, targetHealth =  80, overHealLimit = 80},
		[PQ_AA] 		= {check = true, isKnown = IsPlayerSpell(PQ_AA), overRide = false, targetHealth =  80, overHealLimit = 80},
		[PQ_PS] 		= {check = true, isKnown = IsPlayerSpell(PQ_PS), overRide = false, targetHealth =  80, overHealLimit = 80},
		[PQ_BH] 		= {check = true, isKnown = IsPlayerSpell(PQ_BH), overRide = false, targetHealth = 60, overHealLimit = 200},
		[PQ_FH] 		= {check = true, isKnown = IsPlayerSpell(PQ_FH), overRide = false, targetHealth = 32, overHealLimit = 102},
		[PQ_GH] 		= {check = true, isKnown = IsPlayerSpell(PQ_GH), overRide = false, targetHealth = 54, overHealLimit = 107},
		[PQ_HN] 		= {check = true, isKnown = IsPlayerSpell(PQ_HN), overRide = false, targetHealth = 80, overHealLimit = 105},
		[PQ_LoF] 		= {check = true, isKnown = IsPlayerSpell(PQ_LoF), overRide = false, targetHealth = 75, overHealLimit = 200},
		[PQ_PoH] 		= {check = true, isKnown = IsPlayerSpell(PQ_PoH), overRide = false, targetHealth = 70, overHealLimit = 200},
		[PQ_PoM] 		= {check = true, isKnown = IsPlayerSpell(PQ_PoM), overRide = false, targetHealth = 90, overHealLimit = 105},
		[PQ_PWB] 		= {check = true, isKnown = IsPlayerSpell(PQ_PWB), overRide = false, targetHealth =  80, overHealLimit = 80},
		[PQ_HWC] 		= {check = true, isKnown = IsPlayerSpell(PQ_HWC), overRide = false, targetHealth = 75, overHealLimit = 105},
		[PQ_CoH] 		= {check = true, isKnown = IsPlayerSpell(PQ_CoH), overRide = false, targetHealth = 70, overHealLimit = 105},
		[PQ_Heal] 		= {check = true, isKnown = IsPlayerSpell(PQ_Heal), overRide = false, targetHealth = 80, overHealLimit = 106},
		[PQ_DHymn] 		= {check = true, isKnown = IsPlayerSpell(PQ_DHymn), overRide = false, targetHealth = 50, overHealLimit = 200},
		[PQ_Renew] 		= {check = true, isKnown = IsPlayerSpell(PQ_Renew), overRide = false, targetHealth = 75, overHealLimit = 100},
		[PQ_Smite] 		= {check = true, isKnown = IsPlayerSpell(PQ_Smite), overRide = false, targetHealth = 70, overHealLimit = 105},
		[PQ_Penance] 	= {check = true, isKnown = IsPlayerSpell(PQ_Penance), overRide = false, targetHealth = 80, overHealLimit = 80},
		[PQ_IFocus]		= {check = true, isKnown = IsPlayerSpell(PQ_IFocus), overRide = false, targetHealth =  80, overHealLimit = 80}
	}
-------------------------------------------------------------------------------
-- Mage Globals
-------------------------------------------------------------------------------
elseif select(2, UnitClass("player")) == "MAGE" then
	print("|cffFFBE69Loading |cff69CCF0Mage|cffFFBE69 Tables ...|cffffffff")
	
	-- Skills
	PQ_Frostbolt	= 116		-- Frostbolt
	PQ_FFB			= 44614		-- Frostfire Bolt
	PQ_IL			= 30455		-- Ice Lance
	PQ_FO			= 84714		-- Frozen Orb
	PQ_CoC			= 120		-- Cone of Cold
	PQ_Pyro			= 11366		-- Pyroblast
	PQ_IBlast		= 108853	-- Inferno Blast
	PQ_FS			= 2120		-- Flamestrike
	PQ_Fireball		= 133		-- Fireball
	PQ_Blizzard		= 10		-- Blizzard
	PQ_Freeze		= 33395		-- Pet: Freeze
	
	-- Cooldowns
	PQ_IB			= 45438		-- Ice Block
	PQ_MI			= 55342		-- Mirror Image
	--PQ_IV			= 131078	-- Icy Veins
	PQ_IV			= 12472		-- Icy Veins
	PQ_Evo			= 12051		-- Evocation
	PQ_Comb			= 11129		-- Combustion
	
	-- Buffs
	PQ_WElm			= 31687		-- Summon: Water Elemental
	PQ_MA			= 30482		-- Molten Armor
	PQ_MAA			= 6117		-- Mage Armor
	PQ_ABril		= 1459		-- Arcane Brilliance
	PQ_DBril		= 61316		-- Dalaran Brilliance
	PQ_FA			= 7302		-- Frost Armor
	PQ_InvoBuff		= 116257	-- Invocation Buff
	PQ_AT			= 108978	-- Alter Time
	PQ_ATB			= 110909	-- Alter Time Buff
	
	-- Procs
	PQ_BrainF		= 57761		-- Brain Freeze
	PQ_FoF			= 44544		-- Fingers of Frost
	PQ_HU			= 48107		-- Heating Up
	PQ_PY			= 48108		-- Pyroblast!
	
	-- Talents
	PQ_POM			= 12043		-- Presence of Mind
	PQ_Scorch		= 2948		-- Scorch
	PQ_RoF			= 113724	-- Ring of Frost
	
	PQ_Temporal		= 115610	-- Temporal Shield
	PQ_Barrier		= 11426		-- Ice Barrier
	
	PQ_IW			= 111264	-- Ice Ward
	PQ_FJ			= 102051	-- Frost Jaw
	PQ_GI			= 110959	-- Greater Invisibility
	
	PQ_CS			= 11958		-- Cold Snap
	PQ_NT			= 114923	-- Nether Tempest
	PQ_LB			= 44457		-- Living Bomb
	PQ_FrostBomb	= 112948	-- Frost Bomb
	PQ_Invo			= 114003	-- Invocation
	PQ_RoP			= 116011	-- Rune of Power
	PQ_Ward			= 1463		-- Incanter's Ward
	
	-- Spell Table
	Nova_Spell = {
		[PQ_GI]			= {check = true, known = IsPlayerSpell(PQ_GI)},
		[PQ_IW]			= {check = true, known = IsPlayerSpell(PQ_IW)},
		[PQ_AT]			= {check = true, known = IsPlayerSpell(PQ_AT)},
		[PQ_IL]			= {check = true, known = IsPlayerSpell(PQ_IL)},
		[PQ_FO]			= {check = true, known = IsPlayerSpell(PQ_FO)},
		[PQ_MA]			= {check = true, known = IsPlayerSpell(PQ_MA)},
		[PQ_LB]			= {check = true, known = IsPlayerSpell(PQ_LB)},
		[PQ_FS]			= {check = true, known = IsPlayerSpell(PQ_FS)},
		[PQ_NT]			= {check = true, known = IsPlayerSpell(PQ_NT)},
		[PQ_FJ]			= {check = true, known = IsPlayerSpell(PQ_FJ)},
		[PQ_CS]			= {check = true, known = IsPlayerSpell(PQ_CS)},
		[PQ_IB]			= {check = true, known = IsPlayerSpell(PQ_IB)},
		[PQ_MI]			= {check = true, known = IsPlayerSpell(PQ_MI)},
		[PQ_IV]			= {check = true, known = IsPlayerSpell(PQ_IV)},
		[PQ_FA]			= {check = true, known = IsPlayerSpell(PQ_FA)},
		[PQ_RoP]		= {check = true, known = IsPlayerSpell(PQ_RoP)},
		[PQ_RoF]		= {check = true, known = IsPlayerSpell(PQ_RoF)},
		[PQ_FFB]		= {check = true, known = IsPlayerSpell(PQ_FFB)},
		[PQ_MAA]		= {check = true, known = IsPlayerSpell(PQ_MAA)},
		[PQ_Evo]		= {check = true, known = IsPlayerSpell(PQ_Evo)},
		[PQ_CoC]		= {check = true, known = IsPlayerSpell(PQ_CoC)},
		[PQ_POM]		= {check = true, known = IsPlayerSpell(PQ_POM)},
		[PQ_Ward]		= {check = true, known = IsPlayerSpell(PQ_Ward)},
		[PQ_Invo]		= {check = true, known = IsPlayerSpell(PQ_Invo)},
		[PQ_WElm]		= {check = true, known = IsPlayerSpell(PQ_WElm)},
		[PQ_Comb]		= {check = true, known = IsPlayerSpell(PQ_Comb)},
		[PQ_Pyro]		= {check = true, known = IsPlayerSpell(PQ_Pyro)},
		[PQ_ABril]		= {check = true, known = IsPlayerSpell(PQ_ABril)},
		[PQ_DBril]		= {check = true, known = IsPlayerSpell(PQ_DBril)},
		[PQ_Freeze]		= {check = true, known = IsPlayerSpell(PQ_Freeze)},
		[PQ_IBlast]		= {check = true, known = IsPlayerSpell(PQ_IBlast)},
		[PQ_Scorch]		= {check = true, known = IsPlayerSpell(PQ_Scorch)},
		[PQ_Barrier]	= {check = true, known = IsPlayerSpell(PQ_Barrier)},
		[PQ_Fireball]	= {check = true, known = IsPlayerSpell(PQ_Fireball)},
		[PQ_Blizzard]	= {check = true, known = IsPlayerSpell(PQ_Blizzard)},
		[PQ_Temporal]	= {check = true, known = IsPlayerSpell(PQ_Temporal)},
		[PQ_Frostbolt]	= {check = true, known = IsPlayerSpell(PQ_Frostbolt)},
		[PQ_FrostBomb]	= {check = true, known = IsPlayerSpell(PQ_FrostBomb)}
	}
-------------------------------------------------------------------------------
-- Druid Globals
-------------------------------------------------------------------------------	
elseif select(2, UnitClass("player")) == "DRUID" then
	print("|cffFFBE69Loading |cffC27C0CDruid|cffFFBE69 Tables ...|cffffffff")
	
	-- Balance Skill ID's
	PQ_InsectSwarm		= 5570		-- Insect Swarm
	PQ_Moonfire			= 8921		-- Moonfire / Sunfire
	PQ_Sunfire			= 93402		-- Sunfire
	PQ_Starsurge		= 78674		-- Starsurge
	PQ_Wrath			= 5176		-- Wrath
	PQ_Starfire			= 2912		-- Starfire
	
	-- AoE Skill ID's
	PQ_Hurricane		= 16914		-- Hurricane
	PQ_Typhoon			= 50516		-- Typhoon
	PQ_WildMushroom		= 88747		-- Wild Mushroom
	PQ_Starfall			= 48505 	-- Starfall
	PQ_SBeam			= 78675		-- Solar Beam
	PQ_Astorm			= 106996	-- Astral Storm (Channeled)
	
	-- DoT ID's
	PQ_Sunfire			= 93402		-- Sunfire DoT
	
	-- Cooldown & Buff ID's
	PQ_AC				= 127663	-- Astral Communion
	PQ_CAlign			= 112071	-- Celestial Alignment
	PQ_WCharge			= 102383	-- Wild Charge
	PQ_Cenarion			= 102351	-- Cenarion Ward
	PQ_Innervate		= 29166		-- Innervate
	PQ_MotW				= 1126		-- Mark of the Wild Skill
	PQ_Hibernate		= 2637		-- Hibernate
	PQ_Tranquility		= 740		-- Tranquility
	PQ_FoN				= 33831		-- Forces of Nature
	
	PQ_MoTW2			= 79061		-- Mark of the Wild Buff
	PQ_Solar			= 48517		-- Solar Eclipse
	PQ_Lunar			= 48518		-- Lunar Eclipse
	
	-- Druid Forms
	PQ_Moonkin			= 24858		-- Moonkin Form
	PQ_Moonkin2			= 1020560	-- Incarnation: Chosen of Elune
	
	-- Spell Table
	Nova_Spell = {
		[PQ_InsectSwarm]	= {check = true, known = IsPlayerSpell(PQ_InsectSwarm)},
		[PQ_Moonfire]		= {check = true, known = IsPlayerSpell(PQ_Moonfire)},
		[PQ_Starsurge]		= {check = true, known = IsPlayerSpell(PQ_Starsurge)},
		[PQ_Wrath]			= {check = true, known = IsPlayerSpell(PQ_Wrath)},
		[PQ_Starfire]		= {check = true, known = IsPlayerSpell(PQ_Starfire)},
		[PQ_Hurricane]		= {check = true, known = IsPlayerSpell(PQ_Hurricane)},
		[PQ_Typhoon]		= {check = true, known = IsPlayerSpell(PQ_Typhoon)},
		[PQ_WildMushroom]	= {check = true, known = IsPlayerSpell(PQ_WildMushroom)},
		[PQ_Starfall]		= {check = true, known = IsPlayerSpell(PQ_Starfall)},
		[PQ_SBeam]			= {check = true, known = IsPlayerSpell(PQ_SBeam)},
		[PQ_Astorm]			= {check = true, known = IsPlayerSpell(PQ_Astorm)},
		[PQ_AC]				= {check = true, known = IsPlayerSpell(PQ_AC)},
		[PQ_CAlign]			= {check = true, known = IsPlayerSpell(PQ_CAlign)},
		[PQ_WCharge]		= {check = true, known = IsPlayerSpell(PQ_WCharge)},
		[PQ_Cenarion]		= {check = true, known = IsPlayerSpell(PQ_Cenarion)},
		[PQ_Innervate]		= {check = true, known = IsPlayerSpell(PQ_Innervate)},
		[PQ_MotW]			= {check = true, known = IsPlayerSpell(PQ_MotW)},
		[PQ_Hibernate]		= {check = true, known = IsPlayerSpell(PQ_Hibernate)},
		[PQ_Tranquility]	= {check = true, known = IsPlayerSpell(PQ_Tranquility)},
		[PQ_FoN]			= {check = true, known = IsPlayerSpell(PQ_FoN)},
		[PQ_Moonkin]		= {check = true, known = IsPlayerSpell(PQ_Moonkin)},
		[PQ_Moonkin2]		= {check = true, known = IsPlayerSpell(PQ_Moonkin2)}
	}
-------------------------------------------------------------------------------
-- Warlock Globals
-------------------------------------------------------------------------------	
elseif select(2,UnitClass("player")) == "WARLOCK" then
	PQR_WriteToChat("|cffFFBE69Loading |cff9482C9Warlock |cffFFBE69Tables ...|cffffffff")
	
	-- Abilities
	PQ_AG			= 980		-- Agony
	PQ_Cor			= 172		-- Corruption
	PQ_UA			= 30108		-- Unstable Affliction
	PQ_Haunt		= 48181		-- Haunt
	PQ_MG			= 103103	-- Malefic Grasp
	PQ_DS			= 1120		-- Drain Soul
	PQ_SB			= 74434		-- Soulburn
	PQ_SS			= 86121		-- Soul Swap
	PQ_SSE			= 86213		-- Soul Swap: Exhale
	PQ_DL			= 689		-- Drain Life
	PQ_HF			= 755		-- Health Funnel
	PQ_Shatter		= 29858		-- Soul Shatter
	PQ_GulDan		= 105174	-- Hand of Gul'dan
	PQ_SoulFire		= 6353		-- Soul Fire
	PQ_ShadowBolt	= 686		-- Shadow Bolt
	PQ_FelFlame		= 77799		-- Fel Flame
	PQ_Hellfire		= 1949		-- Hellfire
	PQ_Meta			= 103958	-- Metamorphosis
	PQ_Doom			= 603		-- Metamorphosis: Doom
	PQ_ToC			= 103964	-- Metamorphosis: Touch of Chaos
	PQ_ImmoAura		= 104025	-- Metamorphosis: Immolation Aura
	
	-- Cooldowns
	PQ_DSM			= 113860	-- Dark Soul: Misery
	PQ_DSK			= 113861	-- Dark Soul: Knowledge
	PQ_SDM			= 18540		-- Summon Doomguard
	PQ_SIF			= 1122		-- Summon Infernal
	PQ_STG			= 112927	-- Summon Terrorguard
	PQ_SAY			= 112921	-- Summon Abyssal
	PQ_UR			= 104773	-- Unending Resolve
	
	-- Buffs
	PQ_DI			= 109773	-- Dark Intent
	
	PQ_ST			= 17941		-- Shadow Trance
	PQ_SSE2			= 86211		-- Soul Swap: Exhale
	PQ_MCore		= 122351	-- Molten Core
	
	-- Dots
	PQ_SFlame		= 47960		-- Shadowflame
	
	-- Magic Vulnerability Debuffs
	PQ_COTE			= 1490		-- Curse of the Elements
	PQ_MP			= 58410		-- Master Poisoner
	PQ_FB			= 34889		-- Fire Breath
	PQ_LB			= 24844		-- Lightning Breath
	PQ_AOTE			= 116202	-- Aura of the Elements
	
	-- Talents
	PQ_DR			= 108359	-- Dark Regeneration
	PQ_SL			= 108370	-- Soul Leech
	PQ_HL			= 108371	-- Harvest Life
	PQ_HOT			= 5484		-- Howl of Terror
	PQ_MC			= 6789		-- Mortal Coil
	PQ_SF			= 30283		-- Shadowfury
	PQ_Soul			= 108415	-- Soul Link
	PQ_SP			= 108416	-- Sacrificial Pact
	PQ_DB			= 110913	-- Dark Bargain
	PQ_BF			= 111397	-- Blood Fear
	PQ_BR			= 111400	-- Burning Rush
	PQ_UW			= 108482	-- Unbound Will
	PQ_Supermacy	= 108499	-- Grimoire of Supermacy
	PQ_Service		= 108501	-- Grimoire of Service
	PQ_Sacrifice	= 108503	-- Grimoire of Sacrifice
	PQ_AV			= 108505	-- Archimonde's Vengeance
	PQ_KC			= 119049	-- Kil'jaeden's Cunning
	PQ_MF			= 108508	-- Mannoroth's Fury
	
	-- Pets
	PQ_Imp			= 688		-- Summon Imp
	PQ_Voidwalker	= 697		-- Summon Voidwalker
	PQ_Succubus		= 712		-- Summon Succubus
	PQ_Felhunter	= 691		-- Summon Felhunter
	PQ_Felguard		= 30146		-- Summon Felguard
	
	-- Grimoire Summons
	PQ_GImp			= 111859	-- Grimoire: Imp
	PQ_GVoidwalker	= 111895	-- Grimoire: Voidwalker
	PQ_GSuccubus	= 111896	-- Grimoire: Succubus
	PQ_GFelhunter	= 111897	-- Grimoire: Felhunter
	PQ_GFelguard	= 111898	-- Grimoire: Felguard
	
	Nova_Spell = {
		[PQ_AG]			= {check = true, known = IsPlayerSpell(PQ_AG)},
		[PQ_UA]			= {check = true, known = IsPlayerSpell(PQ_UA)},
		[PQ_MG]			= {check = true, known = IsPlayerSpell(PQ_MG)},
		[PQ_DS]			= {check = true, known = IsPlayerSpell(PQ_DS)},
		[PQ_SB]			= {check = true, known = IsPlayerSpell(PQ_SB)},
		[PQ_SS]			= {check = true, known = IsPlayerSpell(PQ_SS)},
		[PQ_DL]			= {check = true, known = IsPlayerSpell(PQ_DL)},
		[PQ_HF]			= {check = true, known = IsPlayerSpell(PQ_HF)},
		[PQ_UR]			= {check = true, known = IsPlayerSpell(PQ_UR)},
		[PQ_DR]			= {check = true, known = IsPlayerSpell(PQ_DR)},
		[PQ_SL]			= {check = true, known = IsPlayerSpell(PQ_SL)},
		[PQ_HL]			= {check = true, known = IsPlayerSpell(PQ_HL)},		
		[PQ_MC]			= {check = true, known = IsPlayerSpell(PQ_MC)},
		[PQ_SF]			= {check = true, known = IsPlayerSpell(PQ_SF)},
		[PQ_SP]			= {check = true, known = IsPlayerSpell(PQ_SP)},
		[PQ_DB]			= {check = true, known = IsPlayerSpell(PQ_DB)},
		[PQ_BF]			= {check = true, known = IsPlayerSpell(PQ_BF)},
		[PQ_BR]			= {check = true, known = IsPlayerSpell(PQ_BR)},
		[PQ_UW]			= {check = true, known = IsPlayerSpell(PQ_UW)},
		[PQ_AV]			= {check = true, known = IsPlayerSpell(PQ_AV)},
		[PQ_KC]			= {check = true, known = IsPlayerSpell(PQ_KC)},
		[PQ_MF]			= {check = true, known = IsPlayerSpell(PQ_MF)},
		[PQ_DI]			= {check = true, known = IsPlayerSpell(PQ_DI)},
		[PQ_ToC]		= {check = true, known = IsPlayerSpell(PQ_ToC)},
		[PQ_Cor]		= {check = true, known = IsPlayerSpell(PQ_Cor)},
		[PQ_HOT]		= {check = true, known = IsPlayerSpell(PQ_HOT)},
		[PQ_DSM]		= {check = true, known = IsPlayerSpell(PQ_DSM)},
		[PQ_SDM]		= {check = true, known = IsPlayerSpell(PQ_SDM)},
		[PQ_SIF]		= {check = true, known = IsPlayerSpell(PQ_SIF)},
		[PQ_COTE]		= {check = true, known = IsPlayerSpell(PQ_COTE)},
		[PQ_Meta]		= {check = true, known = IsPlayerSpell(PQ_Meta)},
		[PQ_Doom]		= {check = true, known = IsPlayerSpell(PQ_Doom)},
		[PQ_Soul]		= {check = true, known = IsPlayerSpell(PQ_Soul)},
		[PQ_Haunt]		= {check = true, known = IsPlayerSpell(PQ_Haunt)},
		[PQ_GulDan]		= {check = true, known = IsPlayerSpell(PQ_GulDan)},
		[PQ_Service]	= {check = true, known = IsPlayerSpell(PQ_Service)},
		[PQ_Shatter]	= {check = true, known = IsPlayerSpell(PQ_Shatter)},
		[PQ_Hellfire]	= {check = true, known = IsPlayerSpell(PQ_Hellfire)},
		[PQ_FelFlame]	= {check = true, known = IsPlayerSpell(PQ_FelFlame)},
		[PQ_SoulFire]	= {check = true, known = IsPlayerSpell(PQ_SoulFire)},
		[PQ_Supermacy]	= {check = true, known = IsPlayerSpell(PQ_Supermacy)},
		[PQ_Sacrifice]	= {check = true, known = IsPlayerSpell(PQ_Sacrifice)},
		[PQ_ShadowBolt]	= {check = true, known = IsPlayerSpell(PQ_ShadowBolt)}
	}
-------------------------------------------------------------------------------
--Hunter Globals
-------------------------------------------------------------------------------	
elseif select(2,UnitClass("player")) == "HUNTER" then
	PQR_WriteToChat("|cffFFBE69Loading |cffABD473Hunter |cffFFBE69Tables ...|cffffffff")
	
	--Mark
	PQ_Mark			= 1130			--Hunters Mark
	
	--Shots
	PQ_Serpent 		= 1978 			--Serpent Sting
	PQ_MisDir		= 34477			--Misdirection
	PQ_KillCom		= 34026			--Kill Command
	PQ_Kill			= 53351			--Kill Shot
	PQ_Cobra		= 77767			--Cobra Shot
	PQ_Arcane		= 3044			--Arcane Shot
	PQ_Multi		= 2643			--Multi Shot
	PQ_Aimed    	= 19434   		--Aimed Shot
    PQ_Chimera    	= 53209   		--Chimera Shot
    PQ_Concus    	= 5116     		--Concussive Shot
    PQ_Steady    	= 56641   	 	--Steady Shot
    PQ_Tranq    	= 19801     	--Trang Shot
    PQ_Barrow		= 3674			--Black Arrow
    PQ_Expl			= 53301			--Explosive Shot
    PQ_Scat			= 19503			--Scatter Shot
    
    --Debuffs
    PQ_Widow		= 82654			--Widow Venom
	
	--Cooldowns
	PQ_Bestial		= 19574			--Bestial Wrath
	PQ_Beastin		= 34471			--The Beast Within
	PQ_Rapid		= 3045			--Rapid Fire
	PQ_Ready		= 23989			--Readiness
	PQ_Stamp		= 121818		--Stampede
	PQ_MasCall		= 53271			--Masters Call
	
	
	--Proc Only
	PQ_Focus		= 82692			--Focus Fire
	PQ_Lock			= 56453			--Lock and Load
	PQ_Trill		= 34720			--Thrill of the Hunt
	
	--Talents
	PQ_Exhil		= 109304		--Exhilaration
	PQ_Dire			= 120679		--Dire Beast
	PQ_Fervor		= 82726			--Fervor
	PQ_AMOC			= 131894		--A Muder of Crows
	PQ_Blink		= 130392		--Blink Strike
	PQ_Lynx			= 120697		--Lynx Rush
	PQ_Toss			= 117050		--Glaive Toss
	PQ_Power		= 109259		--Powershot
	PQ_Barrage		= 120360		--Barrage
	
	--Traps
	PQ_Exp			= 13813			--Explosive Trap
	PQ_Fre			= 1499			--Freezing Trap
	PQ_Trapl		= 77769			--Trap Launcher
	
	--Pet
	PQ_Mend			= 136			--Mend Pet
	PQ_Fren			= 19615			--Pet: Frenzy
	
	Nova_Spell = {
		[PQ_Mark]			= {check = true, known = IsPlayerSpell(PQ_Mark)},
		[PQ_Exhil]			= {check = true, known = IsPlayerSpell(PQ_Exhil)},
		[PQ_Trill]			= {check = true, known = IsPlayerSpell(PQ_Trill)},
		[PQ_Beastin]		= {check = true, known = IsPlayerSpell(PQ_Beastin)},
		[PQ_Fren]			= {check = true, known = IsPlayerSpell(PQ_Fren)},
		[PQ_Trapl]			= {check = true, known = IsPlayerSpell(PQ_Trapl)},
		[PQ_Lock]			= {check = true, known = IsPlayerSpell(PQ_Lock)},
		[PQ_Barrow]			= {check = true, known = IsPlayerSpell(PQ_Barrow)},
		[PQ_Expl]			= {check = true, known = IsPlayerSpell(PQ_Expl)},
		[PQ_Scat]			= {check = true, known = IsPlayerSpell(PQ_Scat)},
		[PQ_Widow]			= {check = true, known = IsPlayerSpell(PQ_Widow)},
		[PQ_MasCall]		= {check = true, known = IsPlayerSpell(PQ_MasCall)},
		[PQ_Serpent]		= {check = true, known = IsPlayerSpell(PQ_Serpent)},
		[PQ_MisDir]			= {check = true, known = IsPlayerSpell(PQ_MisDir)},
		[PQ_KillCom]		= {check = true, known = IsPlayerSpell(PQ_KillCom)},
		[PQ_Kill]			= {check = true, known = IsPlayerSpell(PQ_Kill)},
		[PQ_Cobra]			= {check = true, known = IsPlayerSpell(PQ_Cobra)},
		[PQ_Arcane]			= {check = true, known = IsPlayerSpell(PQ_Arcane)},
		[PQ_Multi]			= {check = true, known = IsPlayerSpell(PQ_Multi)},
		[PQ_Bestial]		= {check = true, known = IsPlayerSpell(PQ_Bestial)},
		[PQ_Rapid]			= {check = true, known = IsPlayerSpell(PQ_Rapid)},
		[PQ_Ready]			= {check = true, known = IsPlayerSpell(PQ_Ready)},
		[PQ_Stamp]			= {check = true, known = IsPlayerSpell(PQ_Stamp)},
		[PQ_Focus]			= {check = true, known = IsPlayerSpell(PQ_Focus)},
		[PQ_Dire]			= {check = true, known = IsPlayerSpell(PQ_Dire)},
		[PQ_Fervor]			= {check = true, known = IsPlayerSpell(PQ_Fervor)},
		[PQ_AMOC]			= {check = true, known = IsPlayerSpell(PQ_AMOC)},
		[PQ_Blink]			= {check = true, known = IsPlayerSpell(PQ_Blink)},
		[PQ_Lynx]			= {check = true, known = IsPlayerSpell(PQ_Lynx)},
		[PQ_Toss]			= {check = true, known = IsPlayerSpell(PQ_Toss)},
		[PQ_Power]			= {check = true, known = IsPlayerSpell(PQ_Power)},
		[PQ_Barrage]		= {check = true, known = IsPlayerSpell(PQ_Barrage)},
		[PQ_Exp]			= {check = true, known = IsPlayerSpell(PQ_Exp)},
		[PQ_Fre]			= {check = true, known = IsPlayerSpell(PQ_Fre)},
		[PQ_Mend]			= {check = true, known = IsPlayerSpell(PQ_Mend)},
		[PQ_Aimed]          = {check = true, known = IsPlayerSpell(PQ_Aimed)},
        [PQ_Chimera]        = {check = true, known = IsPlayerSpell(PQ_Chimera)},
        [PQ_Concus]         = {check = true, known = IsPlayerSpell(PQ_Concus)},
        [PQ_Steady]         = {check = true, known = IsPlayerSpell(PQ_Steady)},
        [PQ_Tranq]          = {check = true, known = IsPlayerSpell(PQ_Tranq)}
	}
-------------------------------------------------------------------------------
-- Warrior Globals
-------------------------------------------------------------------------------	
elseif select(2,UnitClass("player")) == "WARRIOR" then
	PQR_WriteToChat("|cffFFBE69Loading |cffC79C6EWarrior |cffFFBE69Tables ...|cffffffff")
	
	--General Abilites
	PQ_bShout		= 6673
	PQ_bStance		= 2457
	PQ_bRage		= 18499
	PQ_bStance		= 2458
	PQ_Charge		= 100
	PQ_Cleave		= 845
	PQ_cShout		= 469
	PQ_dCalm		= 85730
	PQ_dStance		= 71
	PQ_DemorBan		= 114203
	PQ_Disarm		= 676
	PQ_Execute		= 5308
	PQ_Hamstr		= 1715
	PQ_hLeap		= 6544
	PQ_hStrike		= 78
	PQ_hThrow		= 57755
	PQ_Intervene	= 3411
	PQ_iShout		= 5246
	PQ_mBanner		= 114192
	PQ_Pummel		= 6552
	PQ_rallyCry		= 97462
	PQ_Reckless		= 1719
	PQ_sThrow		= 64382
	PQ_sWall		= 871
	PQ_skullBan		= 114207
	PQ_sReflect		= 23920
	PQ_Sunder		= 7386
	PQ_Taunt		= 355
	PQ_Throw		= 122475
	PQ_tClap		= 6343
	PQ_vRush		= 34428
	PQ_Shockwave	= 46968
	PQ_imVictory	= 103840
	
	---Arms Tree
	PQ_cSmash		= 86346
	PQ_dieSword		= 118038
	PQ_mStrike		= 12294
	PQ_Overpower	= 7384
	PQ_Slam			= 1464
	PQ_sweepStrike	= 12328
	PQ_Whirlwind	= 1680
	
	---Fury Tree
	PQ_BloodThirst	= 23881
	PQ_RagingBlow	= 85288
	PQ_WildStrike	= 100130
	
	---Prot Tree
	PQ_dShout		= 1160
	PQ_Devastate	= 20243
	PQ_lStand		= 12975
	PQ_Revenge		= 6572
	PQ_sBarrier		= 112048
	PQ_sBlock		= 2565
	PQ_sSlam		= 23922
	
	--Prot Procs
	PQ_Ultimaum		= 122509
	
-------------------------------------------------------------------------------
-- Rogue Globals
-------------------------------------------------------------------------------	
elseif select(2,UnitClass("player")) == "ROGUE" then
	PQR_WriteToChat("|cffFFBE69Loading |cffFFF569Rogue |cffFFBE69Tables ...|cffffffff")
	
	-- Stealth Abilities
	PQ_Ambush	= 8676
	PQ_Cheap	= 1833
	PQ_Garrote	= 703
	PQ_SWalk	= 114842
	PQ_Sap		= 6770
	PQ_SoC		= 114018
	
	--Abilities
	PQ_Dispatch	= 111240
	PQ_Mut		= 1329
	PQ_Rup		= 1943
	PQ_Envenom	= 32645
	PQ_KShot	= 408
	PQ_Recup	= 73651
	PQ_Kick		= 1766
	PQ_Shiv		= 5938
	PQ_Gouge	= 1776
	PQ_Expose	= 8647
	PQ_SND		= 5171
	
	--CDs
	PQ_Vend		= 79140
	PQ_Tricks	= 57934
	
	-- AoE Abilities
	PQ_CTemp	= 121411
	PQ_FoK		= 51723
	
end